﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace syh876.com.ajax.Account
{
    /// <summary>
    /// CheckUserEmail 的摘要说明
    /// </summary>
    public class CheckUserEmail : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string email = Common.RequestHelper.GetString("txtEmail").Trim();

            bool isexist = SYH.User.BLL.UserSimplyInfo.CheckEmailExist(email);
            if (isexist)
            {
                context.Response.Write("false");
            }
            else
            {
                context.Response.Write("true");
            }
            //if (!string.IsNullOrEmpty(email))
            //{
            //    if (Common.PageValidate.IsEmail(email))
            //    {
            //        if (!SYH.User.BLL.UserSimplyInfo.CheckEmailExist(email))
            //        {
            //            context.Response.Write("y");
            //        }
            //        else
            //        {
            //            context.Response.Write("该邮箱已被注册");
            //        }
            //    }
            //    else
            //    {
            //        context.Response.Write("非法email");
            //    }
            //}
            //else
            //{
            //    context.Response.Write("邮箱不能为空");
            //}
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}